package com.heng.commons.a4_全局异常处理机制;


import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(Exception.class)
    public String tt(Exception e) {
        return e.getMessage();
    }

    @ExceptionHandler(TestException.class)
    public String re(Exception msg) {

        return "sdsa " + msg.getMessage();
    }

}
